Row

Graf Run downloadDeploy dashboard

Row

Todesfälle Schweiz

Auszug 100 Records

Wöchentlicher Nachtrag

Opendata, Todesfälle, Sterblichkeit, Todesursachen, Mortalitätsmonitoring (MOMO)

Logdatei

---
title: "Mortalitätsmonitoring Schweiz"
knit: (function(input_file, encoding) {
  out_dir <- '_book';
  if (!dir.exists(out_dir)) dir.create(out_dir);
  rmarkdown::render(input_file,
  encoding=encoding,
  output_file=file.path(dirname(input_file), out_dir, 'index.html'))})
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
---

```{r setup, include=FALSE}
library(dygraphs)
library(dplyr)
library(readr)
source('momodyfun.R')

# select timeseries by canton
ktlist <- c('CH','ZH','BE','VD','TI')

dft1 <- dyfun('../data/todesfaelle_woche.csv', '../data/grossregionCH.csv') %>%
  filter(kt %in% ktlist) 

```

Row
---------------------------------------------------

### Graf ![Run download](https://github.com/norman-ds/momo/workflows/Run%20download/badge.svg)![Deploy dashboard](https://github.com/norman-ds/momo/workflows/Deploy%20dashboard/badge.svg)
```{r}
# read data with dyfun and convert to timeseries
dft2 <- dft1 %>%
  count(kt,date, wt=value, name='value') %>%
  split(.$kt)
dft2 <- dft2[ktlist]
tslist <- lapply(dft2, function(x) {
  xts::xts(x$value, order.by = x$date)
  })
tss <- do.call(cbind,tslist)
dygraph(tss, main = "Todesfälle Schweiz") %>% 
  dyOptions(stepPlot = T) %>%
  dyHighlight(highlightCircleSize = 5, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = FALSE) %>% 
  dyRangeSelector(dateWindow = c("2013-07-01", as.character(last(dft1$date)))) %>%
  dyEvent("2020-3-17", "Lockdown", labelLoc = "bottom")
```


Row {.tabset .tabset-fade}
---------------------------------------------------
### Todesfälle Schweiz

Auszug 100 Records

```{r}
dft1 %>% filter(row_number()>n()-100) %>%
DT::datatable(class = 'cell-border stripe')
```

### Wöchentlicher Nachtrag

[Opendata](https://opendata.swiss/de/dataset/todesfalle-nach-funf-jahres-altersgruppe-geschlecht-woche-und-kanton-csv-datei5),
[Todesfälle](https://www.bfs.admin.ch/bfs/de/home/statistiken/bevoelkerung/geburten-todesfaelle/todesfaelle.html),
[Sterblichkeit, Todesursachen](https://www.bfs.admin.ch/bfs/de/home/statistiken/gesundheit/gesundheitszustand/sterblichkeit-todesursachen.html),
[Mortalitätsmonitoring (MOMO)](https://www.experimental.bfs.admin.ch/de/momo.html)


```{r}
dfdiff <- read_csv2('../data/diff.csv') 
DT::datatable(dfdiff, class = 'cell-border stripe')
```

### Dokumentation

- [Opendata](https://opendata.swiss/de/dataset/todesfalle-nach-funf-jahres-altersgruppe-geschlecht-woche-und-kanton-csv-datei5)
- [Todesfälle](https://www.bfs.admin.ch/bfs/de/home/statistiken/bevoelkerung/geburten-todesfaelle/todesfaelle.html)
- [Sterblichkeit, Todesursachen](https://www.bfs.admin.ch/bfs/de/home/statistiken/gesundheit/gesundheitszustand/sterblichkeit-todesursachen.html)
- [Mortalitätsmonitoring (MOMO)](https://www.experimental.bfs.admin.ch/de/momo.html)


### Logdatei

```{r}
dflog <- read_csv2('../data/log.csv')
DT::datatable(dflog, class = 'cell-border stripe')
```